//
//  FFPlaceholdView.m
//  beichoo_N_ios
//
//  Created by fanfan on 2017/9/23.
//  Copyright © 2017年 陈健. All rights reserved.
//

#import "FFPlaceholdView.h"
#import <Masonry/Masonry.h>
#import "UIColor+Expand.h"
@implementation FFPlaceholdView

/*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.
 - (void)drawRect:(CGRect)rect {
 // Drawing code
 }
 */
- (void)layoutSubviews
{
    [super layoutSubviews];
    
    if (_isMCTabelView == YES) {
        [[self phImgView] mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self);
            make.centerY.equalTo(self).offset(-64 - 100);
            make.width.equalTo(@207);
            make.height.equalTo(@104);
        }];
    }
    else {
        [[self phImgView] mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self);
            make.centerY.equalTo(self);
            make.width.equalTo(@207);
            make.height.equalTo(@104);
        }];
    }
    
    
    [[self alertLab] mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self);
        make.height.equalTo(@14);
        make.top.equalTo(self.phImgView.mas_bottom).offset(25);
    }];
}
- (UIImageView *)phImgView
{
    if (!_phImgView) {
        _phImgView = [[UIImageView alloc]init];
        [self addSubview:_phImgView];
        [_phImgView setImage:[UIImage imageNamed:@"img_table_empty"]];
    }
    return _phImgView;
}
- (UILabel *)alertLab
{
    if (!_alertLab) {
        _alertLab = [[UILabel alloc]init];
        [self addSubview:_alertLab ];
        _alertLab.font = [UIFont systemFontOfSize:14];
        _alertLab.textColor = [UIColor colorWithHexString:@"#666666"];
        _alertLab.text = @"这里什么都没有...";
        _alertLab.textAlignment = NSTextAlignmentCenter;
    }
    return _alertLab;
}
@end
